using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace MyPhotoIndex.Plugins.ImageFormatProviders
{
    internal class WinStructs
    {
        public const int WS_CHILD = 0x40000000;
        public const int WS_CLIPCHILDREN = 0x2000000;

        /// <summary>
        /// The VIDEOINFOHEADER structure describes the bitmap and color information for a video image
        /// </summary>
        [StructLayout(LayoutKind.Sequential)]
        public struct VIDEOINFOHEADER
        {
            /// <summary>RECT structure that specifies the source video window. This structure can be a clipping rectangle, to select a portion of the source video stream.</summary>
            public RECT rcSource;
            /// <summary>RECT structure that specifies the destination video window.</summary>
            public RECT rcTarget;
            /// <summary>Approximate data rate of the video stream, in bits per second</summary>
            public uint dwBitRate;
            /// <summary>Data error rate, in bit errors per second</summary>
            public uint dwBitErrorRate;
            /// <summary>The desired average display time of the video frames, in 100-nanosecond units. The actual time per frame may be longer. See Remarks.</summary>
            public long AvgTimePerFrame;
            /// <summary>BITMAPINFOHEADER structure that contains color and dimension information for the video image bitmap. If the format block contains a color table or color masks, they immediately follow the bmiHeader member. You can get the first color entry by casting the address of member to a BITMAPINFO pointer</summary>
            public BITMAPINFOHEADER bmiHeader;
        }

        [StructLayout(LayoutKind.Sequential)]
        public struct RECT
        {
            int left;
            int top;
            int right;
            int bottom;
        }

        /// <summary>
        /// The BITMAPINFOHEADER structure contains information about the dimensions and color format of a device-independent bitmap (DIB). 
        /// SEE MSDN
        /// </summary>
        [StructLayout(LayoutKind.Sequential)]
        public struct BITMAPINFOHEADER
        {
            /// <summary>Specifies the number of bytes required by the structure. This value does not include the size of the color table or the size of the color masks, if they are appended to the end of structure. See Remarks.</summary>
            public uint biSize;
            /// <summary>Specifies the width of the bitmap, in pixels. For information about calculating the stride of the bitmap, see Remarks.</summary>
            public int biWidth;
            /// <summary>Specifies the height of the bitmap, in pixels. SEE MSDN</summary>
            public int biHeight;
            /// <summary>Specifies the number of planes for the target device. This value must be set to 1</summary>
            public ushort biPlanes;
            /// <summary>Specifies the number of bits per pixel (bpp).  For uncompressed formats, this value gives to the average number of bits per pixel. For compressed formats, this value gives the implied bit depth of the uncompressed image, after the image has been decoded.</summary>
            public ushort biBitCount;
            /// <summary>For compressed video and YUV formats, this member is a FOURCC code, specified as a DWORD in little-endian order. For example, YUYV video has the FOURCC 'VYUY' or 0x56595559. SEE MSDN</summary>
            public uint biCompression;
            /// <summary>Specifies the size, in bytes, of the image. This can be set to 0 for uncompressed RGB bitmaps</summary>
            public uint biSizeImage;
            /// <summary>Specifies the horizontal resolution, in pixels per meter, of the target device for the bitmap</summary>
            public int biXPelsPerMeter;
            /// <summary>Specifies the vertical resolution, in pixels per meter, of the target device for the bitmap</summary>
            public int biYPelsPerMeter;
            /// <summary>Specifies the number of color indices in the color table that are actually used by the bitmap. See Remarks for more information.</summary>
            public uint biClrUsed;
            /// <summary>Specifies the number of color indices that are considered important for displaying the bitmap. If this value is zero, all colors are important</summary>
            public uint biClrImportant;
        }
    }
}
